package com.yidu.service.impl;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Service;

import com.yidu.common.Tools;
import com.yidu.dao.ListenFinanceDetailMapper;
import com.yidu.dao.ListenFinanceMapper;
import com.yidu.dao.ListenSellDetailMapper;
import com.yidu.dao.ListenSellMapper;
import com.yidu.dao.ListenStockMapper;
import com.yidu.dao.ListenStockRecordMapper;
import com.yidu.domain.ListenBackstageUser;
import com.yidu.domain.ListenFinance;
import com.yidu.domain.ListenFinanceDetail;
import com.yidu.domain.ListenSell;
import com.yidu.domain.ListenSellDetail;
import com.yidu.domain.ListenStock;
import com.yidu.domain.ListenStockRecord;
import com.yidu.service.ListenSellService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jiangyu
 * @since 2018-11-27
 */
@Service
public class ListenSellServiceImpl implements ListenSellService {

	@Resource
	private ListenSellMapper sellDao;
	
	@Resource
	ListenSellDetailMapper sellDetailDao;
	
	@Resource
	ListenFinanceMapper financeDao;
	@Resource
	ListenFinanceDetailMapper financeDetailDao;
	
	@Resource
	ListenStockMapper stockDao;
	@Resource
	ListenStockRecordMapper stockRecordDao;
	
	@Override
	public List<ListenSell> selectAll(Map<String, Object> map) {
		
		return sellDao.selectAll(map);
	}

	@Override
	public int selectAllCount(Map<String, Object> map) {
		
		return sellDao.selectAllCount(map);
	}

	@Override
	public int updateState(ListenSell listenSell) {
		return sellDao.updateByPrimaryKeySelective(listenSell);
	}

	@Override
	public List<ListenSell> selectState(Map<String, Object> map) {
		return sellDao.selectAdiut(map);
	}

	@Override
	public int selectAllStateCount(Map<String, Object> map) {
		return sellDao.selectAllStateCount(map);
	}

	@Override
	public List<ListenSell> findByMusicalNumber(String sellId) {
		return sellDao.findByMusicalNumber(sellId);
	}

	@Override
	public List<ListenSell> selectManager(Map<String, Object> map) {
		return sellDao.selectManager(map);
	}

	@Override
	public int selectManagerCount(Map<String, Object> map) {
		return sellDao.selectManagerCount(map);
	}

	@Override
	public int updateAddNumber(ListenStock listenStock) {
		return sellDao.updateAddNumber(listenStock);
	}

	@Override
	public int updateMinusNumber(ListenStock listenStock) {
		return sellDao.updateMinusNumber(listenStock);
	}

	@Override
	public int updateAddMoney(ListenFinance finance) {
		return sellDao.updateAddMoney(finance);
	}

	@Override
	public int updateMinusMoney(ListenFinance finance) {
		return sellDao.updateMinusMoney(finance);
	}

	@Override
	public int deleteById(String Id) {
		return sellDao.deleteByPrimaryKey(Id);
	}

	@Override
	public List<ListenSell> selectReturn(Map<String, Object> map) {
		return sellDao.selectReturn(map);
	}

	@Override
	public int selectReturnCount(Map<String, Object> map) {
		return sellDao.selectReturnCount(map);
	}

	@Override
	public int addStock(ListenStock listenStock) {
		return stockDao.insertSelective(listenStock);
	}

	@Override
	public ListenSell findBySellId(String id) {
		return sellDao.selectByPrimaryKey(id);
	}

	@Override
	public int update(ListenSell listenSell) {
		// TODO Auto-generated method stub
		return sellDao.updateByPrimaryKeySelective(listenSell);
	}
	
	

}
